<template>
  <div>{{ msg }}</div>
  <button @click="count++">{{ count }}</button>
  <p>{{ useInfo}}</p>
  <p>{{ userInfoStore}}</p>
</template>

<script>
import { mapStores } from 'pinia'
import {getUserInfo} from "@api/system/login";
import {useUserStore} from  '@/store/index.js'
export default {
  props: ['msg'],
  computed: {
    ...mapStores(useUserStore),
  },
  data() {
    return {
      count: 0,
      useInfo: {}
    }
  },
  methods: {
    async getUserInfo() {
      const res = await getUserInfo()

      this.useInfo = res
    }
  },
  created() {
    console.log(this)
    this.getUserInfo()
    console.log('create...')
  },
  mounted() {
    console.log('mounted...')
  }
}
</script>